package com.example.demo.pojos;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

@Entity
public class Customersource {
    private int sourceId;
    private String sourceName;
    private Integer sourceUsing;

    @Id
    @Column(name = "source_id", nullable = false)
    public int getSourceId() {
        return sourceId;
    }

    public void setSourceId(int sourceId) {
        this.sourceId = sourceId;
    }

    @Basic
    @Column(name = "source_name", nullable = true, length = 20)
    public String getSourceName() {
        return sourceName;
    }

    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }

    @Basic
    @Column(name = "source_using", nullable = true)
    public Integer getSourceUsing() {
        return sourceUsing;
    }

    public void setSourceUsing(Integer sourceUsing) {
        this.sourceUsing = sourceUsing;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customersource that = (Customersource) o;
        return sourceId == that.sourceId &&
                Objects.equals(sourceName, that.sourceName) &&
                Objects.equals(sourceUsing, that.sourceUsing);
    }

    @Override
    public int hashCode() {
        return Objects.hash(sourceId, sourceName, sourceUsing);
    }
}
